<template>
  <el-drawer
        title="发表评价"
        size="400px"
        :visible.sync="drawer"
        direction="rtl"
        :before-close="handleClose">
        <el-divider>客观真实的评价能帮助用户做决策</el-divider>
          <div style="padding: 0px 10px;">
            <div class="goods">
            <el-image
            style="width: 60px; height: 60px" src="url" fit="fit"></el-image>
            <span> 客观真实的评价能帮助用户做决策客观真实的评价能帮助用户做决策</span>
          </div>
          <div class="score">
            <div >描述相符<el-rate v-model="rate1" :colors="colors"> </el-rate></div>
            <div> 物流服务<el-rate v-model="rate2" :colors="colors"> </el-rate></div>
            <div> 服务态度<el-rate v-model="rate3" :colors="colors"> </el-rate></div>
          </div >
            <div class="comment">
              <el-input
                type="textarea" 
                placeholder="请输入内容"
                v-model="textarea"
                maxlength="200"
              >
              </el-input>
              <el-upload
                action="https://jsonplaceholder.typicode.com/posts/"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :on-remove="handleRemove">
                <i class="el-icon-picture"></i>
              </el-upload>
            </div>
          </div>
          <el-button size="small" type="primary">发表评论</el-button>
  </el-drawer>
</template>

<script>
  export default {
    name: 'Comment',
    components: {},
    data() {
      return {
         drawer: true,
         colors: ['#99A9BF', '#F7BA2A', '#FF9900'] ,
         rate1: null,
        rate2: null,
        rate3: null,
        textarea: '',
      };
    },
    created() {},
    methods: {
       handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            this.$emit('close')
            // done();
          })
          .catch(_ => {});
      },
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      }
    }, 
  };
</script>
<style lang="scss" scoped>

::v-deep .el-drawer__header{
  margin:0;
  padding-bottom:15px ;
  background: #f5f6f7;
}
::v-deep .el-drawer__body{
  background: #eff0f1;
  font-size:14px;
  color: rgb(113, 101, 101);
}
.el-divider__text {
  background-color:#eff0f1;
  text-align: center;
  width: 56%;
  font-weight: 400;
  font-size:12px;
  color: rgb(113, 101, 101);
}
.goods{
  display:flex;
  align-items: center;
  border-radius: 8px;
  padding: 10px 10px;
  background:#ffffff;
  .el-image{
    display: block;
    border-radius: 4px;
    margin-right: 10px;
  }
  span{
    width: 270px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden; //隐藏文字
  }
}
.score{
  margin:10px 0;
  background:#ffffff;
  border-radius: 8px;
  padding: 10px;
  div{
    display: flex;
    align-items: center;
    margin: 5px;
    .el-rate{
      margin-left: 5px;
    }
    ::v-deep.el-rate__item{
      margin-left: 10px;
    }
  }
}
.comment{
  background:#ffffff;
  border-radius: 8px;
  padding: 10px;
  height: 400px ;
  // margin-bottom: 100px ;
  ::v-deep .el-textarea__inner{
    height: 250px !important;
    border: none;
    padding: 0;
  }
  ::v-deep .el-upload,
  .el-upload-list, .el-upload-list--picture-card{
    margin:10px 0;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border: 1px dashed #c0ccda;
  }
  .el-upload--picture-card i{
    font-size: 18px;
  }
}
.el-button{
  position: absolute;
  bottom: 0px;
  width: 100%;
}
</style>